Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[editor] HuggingFaceTextGenerationParserPromptSchema #755

Merged
merged 2 commits into from
Jan 4, 2024
Merged

Conversation

rholinshead
Copy link
Contributor

@rholinshead rholinshead commented Jan 4, 2024

[editor] HuggingFaceTextGenerationParserPromptSchema

[editor] HuggingFaceTextGenerationParserPromptSchema

Adding the PromptSchema for HuggingFaceTextGenerationParser, with supported properties from refine_chat_completion_params in the parser implementation. Types obtained from https://github.com/huggingface/huggingface_hub/blob/a331e82aad1bc63038194611236db28fa013814c/src/huggingface_hub/inference/_client.py#L1206 and defaults obtained from https://huggingface.co/docs/api-inference/detailed_parameters if they're listed

Screenshot 2024-01-04 at 3 19 05 PM

Note, this is for the default/core parser which uses inference API. We'll need to add the other prompt schemas for the extension models for gradio.

Will update the hf prompt UX to support actual 'model' in a subsequent diff


Stack created with Sapling. Best reviewed with ReviewStack.

# [editor] PaLMChatParserPromptSchema

Implement the Prompt Schema for PaLM Chat, using the supported params with defaults from https://cloud.google.com/vertex-ai/docs/generative-ai/model-reference/text-chat, selecting those that are defined in the `refine_chat_completion_params` of palm.py:
```
def refine_chat_completion_params(model_settings):
    # completion parameters to be used for Palm's chat completion api
    # messages handled seperately
    supported_keys = {
        "candidate_count",
        "examples",
        "model",
        "temperature",
        "top_k",
        "top_p",
        "context",
    }
 ```

<img width="1853" alt="Screenshot 2024-01-04 at 1 59 24 PM" src="https://github.com/lastmile-ai/aiconfig/assets/5060851/50e08b43-2956-4fa0-98e4-4ab165efb6a9">
# [editor] HuggingFaceTextGenerationParserPromptSchema

Adding the PromptSchema for HuggingFaceTextGenerationParser, with supported properties from `refine_chat_completion_params` in the parser implementation. Types obtained from https://github.com/huggingface/huggingface_hub/blob/a331e82aad1bc63038194611236db28fa013814c/src/huggingface_hub/inference/_client.py#L1206 and defaults obtained from https://huggingface.co/docs/api-inference/detailed_parameters if they're listed

<img width="1080" alt="Screenshot 2024-01-04 at 3 19 05 PM" src="https://github.com/lastmile-ai/aiconfig/assets/5060851/8cb40459-1f7c-42b2-8b35-0333c380be01">


Note, this is for the default/core parser which uses inference API. We'll need to add the other prompt schemas for the extension models for gradio.

Will update the hf prompt UX to support actual 'model' in a subsequent diff
@rholinshead
Copy link
Contributor Author

Landing to unblock bug bashing, will fix forward as needed

@rholinshead rholinshead merged commit 32be9b4 into main Jan 4, 2024
1 check passed
rholinshead added a commit that referenced this pull request Jan 4, 2024
# [editor] Fix Model Search to Ignore Casing

Previously, the model search was doing exact match, including
capitalization. So, searching 'hu' would not show the
"HuggingFaceTextGenerationParser".

Fix by making both search and model names lowercase when filtering:
<img width="354" alt="Screenshot 2024-01-04 at 3 35 46 PM"
src="https://github.com/lastmile-ai/aiconfig/assets/5060851/10baf717-6192-4de8-bab6-046f678ac9ef">


---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with
[ReviewStack](https://reviewstack.dev/lastmile-ai/aiconfig/pull/756).
* __->__ #756
* #755
* #754
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant